package praktikumid.p06_e;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class DateParsing {
	public static void main(String[] args) {
		
		Locale.setDefault(Locale.US);
		String dateString = "Tue, 09 Oct 2012 09:45:01 UT";
		//String dateString = "Tue, 09";
		/*
		 * Mon, 1. okt
		 * Tue
		 * Wed, 30. sept
		 * Thu
		 * Fri
		 * Sat
		 * Sun
		 */
		String pattern = "EEE, dd MMM yyyy HH:mm:ss 'UT'";
		//pattern = "EEE, dd";
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		//Date?
		// 09.10.2012 09:45
		
		try {
			Date date = sdf.parse(dateString);
			System.out.println();
			
			SimpleDateFormat sdfout = new SimpleDateFormat("dd.MM.yyyy HH:mm");
			System.out.println(sdfout.format(date));
			sdf.parse("01.02.20125");
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
			System.out.println(e.getMessage());
		}
	}
	
	
}
